home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-30 | 5.2 KB | 198 lines | [TEXT/MPS ] |
- //
- // Simple Atom Ext.r
- //
- // This installer script source demonstrates how to define and
- // use an Atom Extender. An Atom Extender is used to enhance or
- // replace the default copy mechanism of the Installer. A good
- // example of the use of Atom Extenders is the InstaCompOne atom
- // extender that provides transparent decompression of files
- // during install. Atom extenders can be referenced from file,
- // font, and resource atoms.
- //
- // What this example does :
- // This example defines a simple atom extender which merely mimicks
- // the direct copy mechaism in the Installer. Our simple atom
- // extender is then referenced from both a file and resource atom.
- //
- // Two Custom Install options are provided to the user:
- //
- // 1) Installs a Example File onto the selected target
- // volume, using our Simple Atom Extender, which simulates the
- // default copy mechanism of the Installer.
- //
- // 2) Installs the 'PICT' 1000 resource item from within our Read
- // me file, again, using our Simple Atom Extender.
- //
- // NOTE: When the Atom Extender resource ID entered in an atom is non-zero,
- // such as with this example script, ScriptCheck will look for an
- // accompanying ScriptCheck Extension file. The assumption is that if
- // you are using an Atom Extender, your source files will not be in a
- // format that ScriptCheck can read and get information about.
- //
- // The InstaCompOne atom extender is a good example of this. In
- // the examples that use the InstaCompOne Atom Extender, the ScriptCheck
- // extension provided with InstaCompOne ("InstaCompOneSCExt.rsrc"
- // renamed to "<scriptname>.scx") is used.
- //
- // With this Simple Atom Extender example, we also demonstrate how to define
- // and use your own script check extensions for use with your Atom Extenders.
- // See the source file "DirectCopySCExt.r" for further details.
- //
- //
- // Copyright 1993-1996, Apple Computer, Inc., All Rights Reserved
- //
-
- #include "InstallerTypes.r"
-
- include "DirectCopyExtender"; // include our Atom Extender code resource
-
-
- /************************** Target File Spec. resources **********************************/
- resource 'intf' (10000) {
- format1 {
- noSearchForFile, // use default search path
-
- TypeCrMustMatch, // If this is set to TypeCrMustMatch
- // then a file with a different type
- // and creator than those specified
- // below will not be replaced.
- // If this is set to TypeCrNeedNotMatch
- // then type and creator of an existing
- // target file are ignored.
-
- // The Type and Creator fields will be used to set the
- // file's Type and Creator when a new file is created.
- 'ttro', // TYPE for new file
- 'ttxt', // CREATOR for new file
-
- 0, // finder attribute flags
- // filled by ScriptCheck is value is 0
-
- 1, // creation date for new file
- 1, // modification date for new file
- // NOTE: DATE values are filled
- // by ScriptCheck if the value is 1
-
- 0, // search proc ID ( 'insp' ), none used
-
- ":Example File"
- }
- };
- /************************** Source File Spec. resources **********************************/
- resource 'infs' (20000) {
- 'ttro',
- 'ttxt',
- 0x1,
- noSearchForFile,
- TypeCrMustMatch,
- "Tidbits:Example File"
- };
-
-
- /************************** File Atom resource **********************************/
- resource 'infa' (10000) {
- format1 {
- deleteWhenRemoving,
- deleteWhenInstalling,
- copy,
- dontIgnoreLockedFile,
- dontSetFileLocked,
- useVersProcToCompare,
- srcNeedExist,
- rsrcForkInRsrcFork,
- leaveAloneIfNewer,
- updateExisting,
- copyIfNewOrUpdate,
- rsrcFork,
- dataFork,
- 0,
- 0,
- 10000, // target file spec
- { 20000, 0, 0 },
- 0x04038000, // source file version number
- 0, // no version compare proc
- 129, // resource ID of our atom extender 'inex' resource
- ""
- }
- };
-
-
- /************************** Resource Atom resource **********************************/
- resource 'inra' (10000) {
- format1 {
- dontDeleteWhenRemoving,
- deleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- tgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'PICT',
- 1000,
- 0,
- "",
- { 20000, 'PICT', 1000, 0, "" },
- 0x0,
- 0,
- 129, // resource ID of our atom extender 'inex' resource
- ""
- }
- };
-
- /************************** Atom Extender resource **********************************/
- resource 'inex' (129) {
- format0 {
- sendInitMessage,
- sendBeforeMessage,
- sendAfterMessage,
- sendSuccessMessage,
- sendCancelMessage,
- continueBusyCursors,
- 'infn', // type for atom extender code resource
- 144, // resource ID of atom extender code resource
- 0,
- 50000, // requested memory
- ""
- }
- };
-
-
-
- /************************** Package resources **********************************/
- resource 'inpk' (20037) {
- format0 {
- showsOnCustom,
- notRemovable,
- dontForceRestart,
- 0,
- 0,
- "Example File (using direct copy Atom Extender)",
- {
- 'infa', 10000,
- }
- }
- };
-
-
- resource 'inpk' (20038) {
- format0 {
- showsOnCustom,
- notRemovable,
- dontForceRestart,
- 0,
- 0,
- "PICT ID#1000 from Example File (using direct copy Atom Extender)",
- {
- 'inra', 10000,
- }
- }
- };
-
-
-